/**
 * Copyright 2012 Roger Cockshutt
 * krakenbrau@gmail.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.googlecode.parallelrl.data;

import com.googlecode.parallelrl.util.ColoredChar;
import com.googlecode.parallelrl.util.Point2D;

/**
 * @author Roger Cockshutt
 *
 */
public interface ILevel {

	@Override
	public abstract String toString();

	/**
	 * Identical to setPositionOf(Integer, CoordinatePair).
	 * 
	 * @param entity
	 * @param position
	 */
	@Deprecated
	public abstract boolean addEntityAt(Long entity, Point2D position);

	public abstract boolean isMovableTo(Point2D position);

	public abstract boolean isMovableTo(Integer y, Integer x);

	/**
	 * Set the position of an entity.  Performs checks on:
	 * -level bounds
	 * -square availability (eg. is the square already occupied, or is it a wall, etc.)
	 * 
	 * @param entity The entity to place.
	 * @param newPosition The new position.
	 * @return True if placement was successful, false otherwise.
	 */
	public abstract boolean setPositionOf(Long entity, Point2D newPosition);

	/**
	 * Backbone of the scrolling map display.  Accepts the size of the map window as input,
	 * and returns a 2D array of char representing the area of this level surrounding the player.
	 * 
	 * @param displaySize
	 * @return
	 */
	public abstract ColoredChar[][] getDisplayRegion(Point2D displaySize);

	public abstract Point2D getSize();

}